<template>
	<view class="ticket">
		<view class="item" v-for="(data, index) in list" :key="data.id">
			<item :detClick="detClick" :data="data"></item>
			<view class="btn" v-if="data.t_tstatus != 1" @click="apply(data.tid)">立即使用</view>
		</view>
	</view>
</template>

<script>
	import item from './item';

	export default {
		name: 'ticket',
		components: {
			item,
		},
		props: {
			list: {
				type: Array,
				default: () => [],
			},
			detClick: {
				type: Boolean,
				default: false,
			},
		},
		data() {
			return {};
		},
		methods: {
			apply(id) {
				uni.navigateTo({
					url: '/pages/my/admissionTicket/details/details?id=' + id,
				});
			},
		},
	};
</script>

<style lang="scss" scoped>
	.ticket {
		overflow: hidden;
		.item {
			margin: $submargin-width auto;
			width: 690rpx;
			background: #fff;
			border-radius: 20rpx;
			overflow: hidden;

			.btn {
				width: 140rpx;
				height: 50rpx;
				background: $price-color;
				border-radius: 30rpx;
				font-size: $uni-font-size-12;
				color: #ffffff;
				line-height: 50rpx;
				text-align: center;
				margin: $margin-width;
				float: right;
			}
		}
	}
</style>
